<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="cn.itcast.domain.Student" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查看学生</title>
</head>
<%
    ArrayList<Student> list = new ArrayList<>();
    list.add(new Student("x","22","99"));
    list.add(new Student("xx","25","93"));
    list.add(new Student("xxx","27","89"));
    pageContext.setAttribute("student",list);
%>
<body>
    <c:if test="${not empty student}">
        <table width="170px" border="1px" style=" border: lightskyblue ;margin: 0 auto">
            <tr>
                <td>姓名</td>
                <td>年龄</td>
                <td>成绩</td>
            </tr>
            <c:forEach begin="0" end="${student.size()-1}" var="i">
                <tr>
                    <td>${student.get(i).name}</td>
                    <td>${student.get(i).age}</td>
                    <td>${student.get(i).score}</td>
                </tr>
            </c:forEach>
        </table>
    </c:if>
    <a href="index.jsp">点击跳转</a>
</body>
</html>
